package com.example.g3a1.login

import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.example.base.cons.mvvm.BaseActivity
import com.example.g3a1.databinding.ActivityMainBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : BaseActivity<ActivityMainBinding, LoginViewModel>() {
    override fun initData() {
        viewModel.loginData.observe(this){
            Log.d("aa", it.toString())
            ARouter.getInstance().build("/app/IndexActivity").navigation()
        }
    }

    override fun initView() {

        binding.login.setOnClickListener {
            val uname = binding.uname.text.toString()
            val paw = binding.paw.text.toString()
            viewModel.login(uname,paw)
        }
    }

}